package com.yuzhenxin.bookstore.service;

import com.yuzhenxin.bookstore.dao.BookDao;
import com.yuzhenxin.bookstore.domain.Book;

import java.util.List;

public class BookService {

    private final BookDao bookDao = new BookDao();

    /**
     * 查询所有图书
     */
    public List<Book> findAll() {
        return bookDao.findAll();
    }

    /**
     * 按分类查询图书
     */
    public List<Book> findByCategory(String cid) {
        return bookDao.findByCategory(cid);
    }

    public Book load(String bid) {
        return bookDao.findByBid(bid);
    }
}
